home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-stwico.ads < prev    next >
Text File  |  1994-05-19  |  19KB  |  310 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --           A D A . S T R I N G S . W I D E _ C O N S T A N T S            --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.5 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26. with Ada.Strings.Wide_Maps;
  27. with Ada.Characters.Wide_Latin_1; use Ada.Characters.Wide_Latin_1;
  28.  
  29. package Ada.Strings.Wide_Constants is
  30.  
  31.    Control_Set           : constant Wide_Maps.Wide_Character_Set;
  32.    Graphic_Set           : constant Wide_Maps.Wide_Character_Set;
  33.    Letter_Set            : constant Wide_Maps.Wide_Character_Set;
  34.    Lower_Set             : constant Wide_Maps.Wide_Character_Set;
  35.    Upper_Set             : constant Wide_Maps.Wide_Character_Set;
  36.    Basic_Set             : constant Wide_Maps.Wide_Character_Set;
  37.    Decimal_Digit_Set     : constant Wide_Maps.Wide_Character_Set;
  38.    Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
  39.    Alphanumeric_Set      : constant Wide_Maps.Wide_Character_Set;
  40.    Special_Graphic_Set   : constant Wide_Maps.Wide_Character_Set;
  41.    ISO_646_Set           : constant Wide_Maps.Wide_Character_Set;
  42.    Character_Set         : constant Wide_Maps.Wide_Character_Set;
  43.  
  44.    Lower_Case_Map        : constant Wide_Maps.Wide_Character_Mapping;
  45.    --  Maps to lower case for letters, else identity
  46.  
  47. private
  48.  
  49.    subtype Cset is Wide_Maps.Wide_Character_Set (
  50.      Wide_Character'Val (0) .. Wide_Character'Val (255));
  51.    --  Declare constrained subtype so we can use others in aggregates
  52.  
  53.    Control_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  54.      NUL .. US                                 => True,
  55.      DEL                                       => True,
  56.      Reserved_128 .. APC                       => True,
  57.      others                                    => False);
  58.  
  59.    Graphic_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  60.      NUL .. US                                 => False,
  61.      DEL                                       => False,
  62.      Reserved_128 .. APC                       => False,
  63.      others                                    => True);
  64.  
  65.    Letter_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  66.      'A' .. 'Z'                                => True,
  67.      'a' .. 'z'                                => True,
  68.      UC_A_Grave .. UC_O_Diaeresis              => True,
  69.      UC_O_Oblique_Stroke .. LC_O_Diaeresis     => True,
  70.      LC_O_Oblique_Stroke .. LC_Y_Diaeresis     => True,
  71.      others                                    => False);
  72.  
  73.    Lower_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  74.      'a' .. 'z'                                => True,
  75.      LC_German_Sharp_S   .. LC_O_Diaeresis     => True,
  76.      LC_O_Oblique_Stroke .. LC_Y_Diaeresis     => True,
  77.      others                                    => False);
  78.  
  79.    Upper_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  80.      'A' .. 'Z'                                => True,
  81.      UC_A_Grave          .. UC_O_Diaeresis     => True,
  82.      UC_O_Oblique_Stroke .. UC_Icelandic_Thorn => True,
  83.      others                                    => False);
  84.  
  85.    Basic_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  86.      'A' .. 'Z'                                => True,
  87.      'a' .. 'z'                                => True,
  88.      UC_AE_Diphthong                           => True,
  89.      LC_AE_Diphthong                           => True,
  90.      LC_German_Sharp_S                         => True,
  91.      UC_Icelandic_Thorn                        => True,
  92.      LC_Icelandic_Thorn                        => True,
  93.      UC_Icelandic_Eth                          => True,
  94.      LC_Icelandic_Eth                          => True,
  95.      others                                    => False);
  96.  
  97.    Decimal_Digit_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  98.      '0' .. '9'                                => True,
  99.      others                                    => False);
  100.  
  101.    Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  102.      '0' .. '9'                                => True,
  103.      'A' .. 'F'                                => True,
  104.      'a' .. 'f'                                => True,
  105.      others                                    => False);
  106.  
  107.    Alphanumeric_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  108.      '0' .. '9'                                => True,
  109.      'A' .. 'Z'                                => True,
  110.      'a' .. 'z'                                => True,
  111.      UC_A_Grave .. UC_O_Diaeresis              => True,
  112.      UC_O_Oblique_Stroke .. LC_O_Diaeresis     => True,
  113.      LC_O_Oblique_Stroke .. LC_Y_Diaeresis     => True,
  114.      others                                    => False);
  115.  
  116.    Special_Graphic_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  117.      Space .. Solidus                          => True,
  118.      Colon .. Commercial_At                    => True,
  119.      Left_Square_Bracket .. Grave              => True,
  120.      Left_Curly_Bracket  .. Tilde              => True,
  121.      No_Break_Space      .. Inverted_Question  => True,
  122.      Multiplication_Sign                       => True,
  123.      Division_Sign                             => True,
  124.      others                                    => False);
  125.  
  126.    ISO_646_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  127.      NUL .. DEL                                => True,
  128.      others                                    => False);
  129.  
  130.    Character_Set : constant Wide_Maps.Wide_Character_Set := Cset'(
  131.      others                                    => True);
  132.  
  133.    subtype Lmap_Mapping is Wide_Maps.Wide_Character_Mapping
  134.      (Wide_Character range 'A' .. UC_Icelandic_Thorn);
  135.  
  136.    Lower_Case_Map : constant Wide_Maps.Wide_Character_Mapping
  137.                                                     := Lmap_Mapping'(
  138.      'A'                         => 'a',                           -- 65
  139.      'B'                         => 'b',                           -- 66
  140.      'C'                         => 'c',                           -- 67
  141.      'D'                         => 'd',                           -- 68
  142.      'E'                         => 'e',                           -- 69
  143.      'F'                         => 'f',                           -- 70
  144.      'G'                         => 'g',                           -- 71
  145.      'H'                         => 'h',                           -- 72
  146.      'I'                         => 'i',                           -- 73
  147.      'J'                         => 'j',                           -- 74
  148.      'K'                         => 'k',                           -- 75
  149.      'L'                         => 'l',                           -- 76
  150.      'M'